/**
 * 位运算方法(XOR) 2 ^ 2 ^ 1 = 0 ^ 1 = 1
 * @param {number[]} nums
 * @return {number}
 */
export var singleNumber = function (nums) {
  return nums.reduce((a, b) => a ^ b)
}
